<?php

namespace App\Http\Controllers\Backend;

use App\Http\Resources\Backend\AdminLogResource;
use App\Models\AdminLog;
use Illuminate\Http\Request;

/**
 * Class AdminLogController
 * @package App\Http\Controllers\Backend
 * 管理员操作日志
 */
class AdminLogController extends BackendController
{
    public function index(Request $request)
    {
        $adminLog = AdminLog::orderBy('created_at', 'desc')
            ->usernameLike($request->admin_username)
            ->actionLike($request->action)
            ->paginate($request->size);
        return AdminLogResource::collection($adminLog);
    }
}
